package com.liumingtai.learn.shiro.module.test01.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.liumingtai.learn.shiro.module.test01.entity.BlogUser;
import com.liumingtai.learn.shiro.module.test01.mapper.BlogUserMapper;
import com.liumingtai.learn.shiro.module.test01.service.BlogUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class BlogUserServiceImpl extends ServiceImpl<BlogUserMapper,BlogUser> implements BlogUserService {

    @Autowired
    private BlogUserMapper blogUserMapper;

    //查询所有
    @Override
    public List<BlogUser> listAll(QueryWrapper queryWrapper) {
        List<BlogUser> blogUsers = this.list(queryWrapper);
        return blogUsers;
    }

    //条件查询
    @Override
    public BlogUser listOne(Long id) {
        BlogUser blogUser = this.getById(id);
        return blogUser;
    }

    //保存
    @Override
    public int insert(BlogUser blogUser){
        return blogUserMapper.insert(blogUser);

    }

}
